﻿using System.Data;
using System.Data.SqlClient;
namespace Data
{
    public class UserControl
    {
        private DataProvider _provider = new DataProvider();
        public UserControl()
        {
            _provider.connect();
        }
        public DataTable getDSUser()
        {
            return _provider.getDSUser("NguoiDung_SelectAll");
        }
        public DataSet layallUser()
        {
            return _provider.layalluser("NguoiDung_SelectAll");
        }
        public void Themnguoidung(string Email, string Matkhau, string Hoten, string Diachi, string Sodt, string Sofax, int MaKieuNguoiDung)
        {
            _provider.Themnguoidung(Email, Matkhau, Hoten, Diachi, Sodt, Sofax, MaKieuNguoiDung,"NguoiDung_Insert");
        }
        public void SuaNguoiDung(string Email,string Matkhau, string Hoten, string Diachi, string Sodt, string Sofax, int MaKieuNguoiDung)
        {
            _provider.SuaNguoiDung(Email,Matkhau, Hoten, Diachi, Sodt, Sofax, MaKieuNguoiDung, "NguoiDung_Update");
        }
        public void XoaNguoiDung(string Email)
        {
            _provider.XoaNguoiDung(Email, "NguoiDung_Delete");
        }
    }
}
